package cn.com.dhcc.ddi.datasource.vo.wapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import cn.com.dhcc.app.core.handler.dbhandler.WappedResultSet;
import cn.com.dhcc.ddi.datasource.vo.TableInfoVo;
/**
 * 
 * 表信息RowWapper
 * @Author: fxx
 * @date: 2017-5-16
 *
 */
public class TableInfoRowWapper implements RowMapper<TableInfoVo> {
	@Override
	public TableInfoVo mapRow(ResultSet rss, int rowNum) throws SQLException {
		WappedResultSet rs = new WappedResultSet(rss);
		TableInfoVo vo = new TableInfoVo();
		vo.setId(rs.getString("id"));
		vo.setDsId(rs.getString("ds_id"));
		vo.setTableName(rs.getString("table_name"));
		vo.setSchema(rs.getString("schema_name"));
		vo.setTableComment(rs.getString("table_comment"));
		if (rs.getInteger("table_order") != null) {
			vo.setTableOrder(rs.getInteger("table_order"));
		}
		vo.setMtime(rs.getTimestamp("mtime"));
		vo.setWhereCondition(rs.getString("where_condition"));
		return vo;
	}
}
